/**
 * 接收popup发送过来的信息
 */
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
  if (request.type === "popMsg") {
    console.log("收到来自popup的消息：" + request.value);
  }

  let node = document.getElementsByClassName("tab-trigger");
  let image_list = [];
  console.log(node);
  for (let i = 0; i < node.length; i++) {
    image_list.push(node[i].dataset.img);
  }

  // 给popup返回信息
  sendResponse(image_list);
});

window.addEventListener("load", function () {
  console.log("Load Done.");
  console.log("Start Download");
});
